-
Notifications
You must be signed in to change notification settings - Fork 1.1k
INT-4520 Make IntegrationGraphServer customizable #2608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool stiuff
/** | ||
* Get beans for provided type from the application context. | ||
* This method can be extended for some custom logic, e.g. get beans | ||
* form the parent application context as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo form
for the provided type
* @param value the value of the property | ||
* @since 5.1 | ||
*/ | ||
public void addProperty(String name, Object value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
null checks?
src/reference/asciidoc/graph.adoc
Outdated
@@ -147,6 +147,25 @@ It is also used in the `links` element to represent a relationship (connection) | |||
The `input` and `output` attributes are for the `inputChannel` and `outputChannel` properties of the `AbstractEndpoint`, `MessageHandler`, `SourcePollingChannelAdapter`, or `MessageProducerSupport`. | |||
See the next section for more information. | |||
|
|||
Starting with version 5.1, the `IntegrationGraphServer` accepts a `Function<NamedComponent, Map<String, Object>> additionalPropertiesCallback` for population additional properties on the `IntegrationNode` for particular `NamedComponent`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for population of additional
for a particular
@@ -147,6 +147,25 @@ It is also used in the `links` element to represent a relationship (connection) | |||
The `input` and `output` attributes are for the `inputChannel` and `outputChannel` properties of the `AbstractEndpoint`, `MessageHandler`, `SourcePollingChannelAdapter`, or `MessageProducerSupport`. | |||
See the next section for more information. | |||
|
|||
Starting with version 5.1, the `IntegrationGraphServer` accepts a `Function<NamedComponent, Map<String, Object>> additionalPropertiesCallback` for population additional properties on the `IntegrationNode` for particular `NamedComponent`. | |||
For example you can expose a `SmartLifecycle` `autoStartup` and `running` properties into the target graph: | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expose the ...
@@ -210,3 +210,9 @@ e.g. `org.springframework.integration:type=MessageChannel,` `name="input#foo.myG | |||
|
|||
It is now simpler to customize the standard Micrometer meters created by the framework. | |||
See <<micrometer-integration>> for more information. | |||
|
|||
[[x51.-integration-graph]] | |||
=== The Integration Graph Customization |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove The
.
@@ -76,6 +81,27 @@ public Stats getStats() { | |||
return this.properties.size() == 0 ? null : this.properties; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nullable
on this getter? Or, maybe we should just always return it, even if empty.
Also, now that we have a mechanism to modify the map, maybe we should return an UnmodifableMap
- if so, it should be a field instead of wrapping the map on every call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean we should use a BiConsumer<NamedComponent, Map<String, Object>>
instead of that Function
for additional properties?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
No; I just mean that now we have IN.addProperty()
and addProperties()
we no longer need to expose a direct reference to properties field.
JIRA: https://jira.spring.io/browse/INT-4520